import { Component,ViewChild } from '@angular/core';
import { Nav,Platform } from 'ionic-angular';
import { StatusBar } from 'ionic-native';

// 导入其他组件
import { TabsPage } from '../pages/tabs/tabs';
// 组件的依赖
@Component({
  template: '<ion-nav [root]="rootPage"></ion-nav>'
})

// 定义组件
export class MyApp {
  @ViewChild(Nav) nav: Nav;
  rootPage = TabsPage;


  constructor(platform: Platform) {
    platform.ready().then(() => {
      // Okay, so the platform is ready and our plugins are available.
      // Here you can do any higher level native things you might need.
      StatusBar.styleDefault();
    });
  }
  
  openPage(page) {
    // Reset the content nav to have just this page
    // we wouldn't want the back button to show in this scenario
    this.nav.setRoot(page);
  }
}
